class MyArray<T> {
    public T[] array = (T[])new Object[10];
    public T getPos(int pos) {
        return this.array[pos];
    }
    public void setVal(int pos,T val) {
        this.array[pos] = val;
    }
    public T[] getArray() {
        return array;
    }
}

public class Test2 <T>{
    public static void main(String[] args) {
        MyArray<Integer> myArray1 = new MyArray<>();
        Integer[] integers = myArray1.getArray();
    }
    public static void main1(String[] args) {
        MyArray myArray1 = new MyArray();
        myArray1.setVal(0,"adf");
        myArray1.setVal(1,89);
        myArray1.setVal(2,'a');
        Object[] array = myArray1.getArray();
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+" ");
        }

    }
}
